package IOStreamStudy.bufferWriter;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class BufferWriterDemo  {
    public static void main(String[] args) throws IOException {
        String file = "D:\\all_projects\\java_projects\\java_ij\\springMVC\\NetWork" +
                "\\src\\cn\\usts\\edu\\IOStreamStudy\\bufferWriter\\a.txt";
        FileWriter fileWriter = new FileWriter(file);
        BufferedWriter bufferedWriter = new BufferedWriter(fileWriter);
        bufferedWriter.write("你好java,我在用java文件写入");
        bufferedWriter.newLine();//插入一个系统换行
        bufferedWriter.write("你好java,我在用java文件写入2\n");
        bufferedWriter.write("你好java,我在用java文件写入3");
        bufferedWriter.close();
    }
}
